package com.ityedao.IO序列化流;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class ObjectInputStreamTest {
    public static void main(String[] args) {
        try (
                ObjectInputStream ois =
                        new ObjectInputStream(
                                new FileInputStream("src\\IO流-序列化流.txt"))
        ) {
            User u = (User) ois.readObject();
            System.out.println(u);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
